import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {SpacesComponent} from "./spaces.component";
import {TablesComponent} from "./tables/tables.component";
import {ProceduresComponent} from "./procedures/procedures.component";
import {DashboardsComponent} from "./dashboards/dashboards.component";
import {WarehouseComponent} from "./warehouse/warehouse.component";
import {TablesListComponent} from "./tables/list/tables.list.component";
import {TablesSettingComponent} from "./tables/setting/tables.setting.component";

const routes: Routes = [
  {
    path: 'spaces/:spaceId', component: SpacesComponent, children: [
      {path: 'tables', component: TablesComponent},
      {path: 'procedures', component: ProceduresComponent},
      {path: 'warehouse', component: WarehouseComponent},
      {path: 'dashboards', component: DashboardsComponent},
      {path: 'tables/create', component: TablesSettingComponent},
      {path: 'tables/:tableId', component: TablesListComponent},
      {path: 'tables/:tableId/setting', component: TablesSettingComponent}
    ]
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)]
})
export class SpacesRoutingModule {
}
